package edu.qhst.team.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.qhst.team.dao.entity.Team;
import edu.qhst.team.dto.req.TeamJoinReqDto;
import edu.qhst.team.dto.req.TeamQueryReqDto;
import edu.qhst.team.dto.req.TeamQuitReqDto;
import edu.qhst.team.dto.req.TeamUpdateReqDto;
import edu.qhst.team.dto.resp.TeamUserRespDto;
import edu.qhst.user.dto.UserSafeInfoDto;

import java.util.List;

/**
 * 队伍服务
 *
 * @author 加浓美式
 * @Date 2023/6/25
 */
public interface TeamService extends IService<Team> {

    /**
     * 创建队伍
     *
     * @param team
     * @return
     */
    long addTeam(Team team, UserSafeInfoDto loginUser);

    /**
     * 搜索队伍
     *
     * @param teamQuery
     * @param isAdmin
     * @return
     */
    List<TeamUserRespDto> listTeams(TeamQueryReqDto teamQuery, boolean isAdmin);

    /**
     * 更新队伍
     *
     * @param teamUpdateRequest
     * @return
     */
    boolean updateTeam(TeamUpdateReqDto teamUpdateRequest, UserSafeInfoDto loginUser);

    /**
     * 加入队伍
     *
     * @param teamJoinRequest
     * @return
     */
    boolean joinTeam(TeamJoinReqDto teamJoinRequest, UserSafeInfoDto loginUser);

    /**
     * 退出队伍
     *
     * @param teamQuitRequest
     * @return
     */
    boolean quitTeam(TeamQuitReqDto teamQuitRequest, UserSafeInfoDto loginUser);

    /**
     * 删除（解散）队伍
     *
     * @param id
     * @return
     */
    boolean deleteTeam(long id, UserSafeInfoDto loginUser);
}

